package com.yunshang.shoppingmall.shopping.Finace;

import com.yunshang.shoppingmall.entity.Hsys.JsonBack;
import com.yunshang.shoppingmall.service.Finace.FinaceService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import java.math.BigDecimal;

@Controller
public class FinaceTestController {

    @Autowired
    FinaceService finaceService;

    @ResponseBody
    @RequestMapping("/testFinace")
    public String FinaceAdd(HttpServletRequest request) {

        String remark = request.getParameter("remark");
        int uid = Integer.parseInt(request.getParameter("uid"));
        BigDecimal amount = BigDecimal.valueOf(Double.parseDouble(request.getParameter("amount")));
        finaceService.insertTestFinace(1,amount,uid,remark,uid,0,777);

        return "";
    }

}
